home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / T2W32307.ZIP / _IEEENUM.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-07  |  10.0 KB  |  311 lines

  1. VERSION 4.00
  2. Begin VB.Form frmIeeenum 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Ieeenum"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin Threed.SSPanel SSPanel1 
  19.       Align           =   1  'Align Top
  20.       Height          =   480
  21.       Left            =   0
  22.       TabIndex        =   1
  23.       Top             =   0
  24.       Width           =   7485
  25.       _Version        =   65536
  26.       _ExtentX        =   13203
  27.       _ExtentY        =   847
  28.       _StockProps     =   15
  29.       ForeColor       =   -2147483640
  30.       BackColor       =   12632256
  31.       Begin VB.ComboBox cmb_Function 
  32.          Height          =   315
  33.          Left            =   1365
  34.          TabIndex        =   2
  35.          Top             =   90
  36.          Width           =   4785
  37.       End
  38.       Begin Threed.SSCommand cmdNP 
  39.          Height          =   300
  40.          Index           =   1
  41.          Left            =   7140
  42.          TabIndex        =   6
  43.          Top             =   90
  44.          Width           =   255
  45.          _Version        =   65536
  46.          _ExtentX        =   450
  47.          _ExtentY        =   529
  48.          _StockProps     =   78
  49.          Caption         =   ">"
  50.          BevelWidth      =   1
  51.          Font3D          =   3
  52.          RoundedCorners  =   0   'False
  53.          Outline         =   0   'False
  54.       End
  55.       Begin Threed.SSCommand cmdNP 
  56.          Height          =   300
  57.          Index           =   0
  58.          Left            =   6300
  59.          TabIndex        =   5
  60.          Top             =   90
  61.          Width           =   255
  62.          _Version        =   65536
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _StockProps     =   78
  66.          Caption         =   "<"
  67.          BevelWidth      =   1
  68.          Font3D          =   3
  69.          RoundedCorners  =   0   'False
  70.          Outline         =   0   'False
  71.       End
  72.       Begin VB.Label Label2 
  73.          Caption         =   "&Select a function"
  74.          Height          =   255
  75.          Left            =   90
  76.          TabIndex        =   4
  77.          Top             =   120
  78.          Width           =   1275
  79.       End
  80.       Begin Threed.SSCommand SSCommand1 
  81.          Default         =   -1  'True
  82.          Height          =   300
  83.          Left            =   6615
  84.          TabIndex        =   3
  85.          Top             =   90
  86.          Width           =   465
  87.          _Version        =   65536
  88.          _ExtentX        =   820
  89.          _ExtentY        =   529
  90.          _StockProps     =   78
  91.          Caption         =   "&Go"
  92.          BevelWidth      =   1
  93.          RoundedCorners  =   0   'False
  94.          Outline         =   0   'False
  95.       End
  96.    End
  97.    Begin VB.Label lbl_Result 
  98.       Appearance      =   0  'Flat
  99.       BackColor       =   &H80000005&
  100.       BackStyle       =   0  'Transparent
  101.       ForeColor       =   &H80000008&
  102.       Height          =   4110
  103.       Left            =   90
  104.       TabIndex        =   0
  105.       Top             =   630
  106.       Width           =   7305
  107.    End
  108. Attribute VB_Name = "frmIeeenum"
  109. Attribute VB_Creatable = False
  110. Attribute VB_Exposed = False
  111. Option Explicit
  112. Option Base 1
  113. Private Const Iteration = 250
  114. Dim IsLoaded         As Integer
  115. Dim TimerStartOk     As Integer
  116. Dim TimerCloseOk     As Integer
  117. Dim TimerHandle      As Integer
  118. Dim TimerValue       As Long
  119. Private Sub cmdNP_Click(Index As Integer)
  120.    Call sub_NextPrev(cmb_Function, Index)
  121. End Sub
  122. Private Sub cmb_Function_Click()
  123.    If (IsLoaded = False) Then Exit Sub
  124.    Call cDisableFI(mdiT2W.Picture1)
  125.    lbl_Result = ""
  126.    DoEvents
  127.    Select Case cmb_Function.ListIndex
  128.       Case 0
  129.          Call TestByte
  130.       Case 1
  131.          Call TestInteger
  132.       Case 2
  133.          Call TestLong
  134.       Case 3
  135.          Call TestSingle
  136.       Case 4
  137.          Call TestDouble
  138.       Case 5
  139.          Call TestCurrency
  140.    End Select
  141.    DoEvents
  142.    Call cEnableFI(mdiT2W.Picture1)
  143. End Sub
  144. Private Sub Form_Activate()
  145.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  146. End Sub
  147. Private Sub Form_Load()
  148.    IsLoaded = False
  149.    Show
  150.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_ieeenum.t2w")
  151.    IsLoaded = True
  152. End Sub
  153. Private Sub SSCommand1_Click()
  154.    Call cmb_Function_Click
  155. End Sub
  156. Private Sub TestByte()
  157.    Dim intResult        As Integer
  158.    Dim strResult        As String
  159.    Dim strDisplay       As String
  160.    Dim i                As Integer
  161.    Dim j                As Byte
  162.    strResult = ""
  163.    strDisplay = ""
  164.      
  165.    For i = 1 To 7
  166.       j = Int((255 - 1 + 1) * Rnd + 1)
  167.       strResult = cMKB(j)
  168.       strDisplay = strDisplay + "MKB of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  169.       strDisplay = strDisplay + "CVB of '0x" & cToHexa(strResult) & "' is '" & cCVB(strResult) & "'" & vbCrLf & vbCrLf
  170.    Next i
  171.    lbl_Result = strDisplay
  172.    'time the function
  173.    TimerHandle = cTimerOpen()
  174.    TimerStartOk = cTimerStart(TimerHandle)
  175.    For i = 1 To Iteration
  176.       strResult = cMKB(j)
  177.    Next i
  178.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  179.    TimerCloseOk = cTimerClose(TimerHandle)
  180. End Sub
  181. Private Sub TestInteger()
  182.    Dim intResult        As Integer
  183.    Dim strResult        As String
  184.    Dim strDisplay       As String
  185.    Dim i                As Integer
  186.    Dim j                As Integer
  187.    strResult = ""
  188.    strDisplay = ""
  189.    Call cRndInit(-1)
  190.      
  191.    For i = 1 To 7
  192.       j = cRndI()
  193.       strResult = cMKI(j)
  194.       strDisplay = strDisplay + "MKI of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  195.       strDisplay = strDisplay + "CVI of '0x" & cToHexa(strResult) & "' is '" & cCVI(strResult) & "'" & vbCrLf & vbCrLf
  196.    Next i
  197.    lbl_Result = strDisplay
  198.    'time the function
  199.    TimerHandle = cTimerOpen()
  200.    TimerStartOk = cTimerStart(TimerHandle)
  201.    For i = 1 To Iteration
  202.       strResult = cMKI(j)
  203.    Next i
  204.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  205.    TimerCloseOk = cTimerClose(TimerHandle)
  206. End Sub
  207. Private Sub TestLong()
  208.    Dim intResult        As Integer
  209.    Dim strResult        As String
  210.    Dim strDisplay       As String
  211.    Dim i                As Integer
  212.    Dim j                As Long
  213.    strResult = ""
  214.    strDisplay = ""
  215.    Call cRndInit(-1)
  216.      
  217.    For i = 1 To 7
  218.       j = cRndL()
  219.       strResult = cMKL(j)
  220.       strDisplay = strDisplay + "MKL of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  221.       strDisplay = strDisplay + "CVL of '0x" & cToHexa(strResult) & "' is '" & cCVL(strResult) & "'" & vbCrLf & vbCrLf
  222.    Next i
  223.    lbl_Result = strDisplay
  224.    'time the function
  225.    TimerHandle = cTimerOpen()
  226.    TimerStartOk = cTimerStart(TimerHandle)
  227.    For i = 1 To Iteration
  228.       strResult = cMKL(j)
  229.    Next i
  230.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  231.    TimerCloseOk = cTimerClose(TimerHandle)
  232. End Sub
  233. Private Sub TestSingle()
  234.    Dim intResult        As Integer
  235.    Dim strResult        As String
  236.    Dim strDisplay       As String
  237.    Dim i                As Integer
  238.    Dim j                As Single
  239.    strResult = ""
  240.    strDisplay = ""
  241.    Call cRndInit(-1)
  242.      
  243.    For i = 1 To 7
  244.       j = cRndS()
  245.       strResult = cMKS(j)
  246.       strDisplay = strDisplay + "MKS of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  247.       strDisplay = strDisplay + "CVS of '0x" & cToHexa(strResult) & "' is '" & cCVS(strResult) & "'" & vbCrLf & vbCrLf
  248.    Next i
  249.    lbl_Result = strDisplay
  250.    'time the function
  251.    TimerHandle = cTimerOpen()
  252.    TimerStartOk = cTimerStart(TimerHandle)
  253.    For i = 1 To Iteration
  254.       strResult = cMKS(j)
  255.    Next i
  256.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  257.    TimerCloseOk = cTimerClose(TimerHandle)
  258. End Sub
  259. Private Sub TestDouble()
  260.    Dim intResult        As Integer
  261.    Dim strResult        As String
  262.    Dim strDisplay       As String
  263.    Dim i                As Integer
  264.    Dim j                As Double
  265.    strResult = ""
  266.    strDisplay = ""
  267.    Call cRndInit(-1)
  268.      
  269.    For i = 1 To 7
  270.       j = cRndD()
  271.       strResult = cMKD(j)
  272.       strDisplay = strDisplay + "MKD of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  273.       strDisplay = strDisplay + "CVD of '0x" & cToHexa(strResult) & "' is '" & cCVD(strResult) & "'" & vbCrLf & vbCrLf
  274.    Next i
  275.    lbl_Result = strDisplay
  276.    'time the function
  277.    TimerHandle = cTimerOpen()
  278.    TimerStartOk = cTimerStart(TimerHandle)
  279.    For i = 1 To Iteration
  280.       strResult = cMKD(j)
  281.    Next i
  282.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  283.    TimerCloseOk = cTimerClose(TimerHandle)
  284. End Sub
  285. Private Sub TestCurrency()
  286.    Dim intResult        As Integer
  287.    Dim strResult        As String
  288.    Dim strDisplay       As String
  289.    Dim i                As Integer
  290.    Dim j                As Currency
  291.    strResult = ""
  292.    strDisplay = ""
  293.    Call cRndInit(-1)
  294.      
  295.    For i = 1 To 7
  296.       j = cRndS()
  297.       strResult = cMKC(j)
  298.       strDisplay = strDisplay + "MKC of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  299.       strDisplay = strDisplay + "CVC of '0x" & cToHexa(strResult) & "' is '" & cCVC(strResult) & "'" & vbCrLf & vbCrLf
  300.    Next i
  301.    lbl_Result = strDisplay
  302.    'time the function
  303.    TimerHandle = cTimerOpen()
  304.    TimerStartOk = cTimerStart(TimerHandle)
  305.    For i = 1 To Iteration
  306.       strResult = cMKC(j)
  307.    Next i
  308.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  309.    TimerCloseOk = cTimerClose(TimerHandle)
  310. End Sub
  311.